
$(function() {	
	$("input[id='emp']:visible").autocomplete(Test.emp);
	
	$('#date').datepicker(_date1_option);
	
	$('#customer').change(function() {
		var a = $(this).val();
		// Pay.supplier(a);
		
		var body = { };
		body.id = a;
		$.getJSON('contact.php?do=Customer.ajax_id', body, function(json) {
			$("#a_name").val(json.name);
			$("#a_fullname").val(json.fullname);
			$("#a_address").val(json.address);
			$("#a_web").val(json.url);
			
			/*
			var s = $("#name").val();
			if (s == null || s == '') {
				$("#name").val(json.code);
			}*/
			
			// $("#emp").val(json.emp);
		});
		
		var body = {};
		body.q = a;
		
		$.getJSON('contact.php?do=Customer.ajax_linkman', body, function(json) {	
			// alert($.toJSON(json));
			Common.linkman(json);
		});
	});
	
	$("#label_linkman_a").hide();
	
	_change("#address", "select[id^='address_t']:visible");

	$('textarea').css("width", 400);
});
